The three virtues of a programmer: Laziness, Impatience, and Hubris. – Larry Wall
Legacy:Mod Ideas/X-Ray
An adrenaline combo that lets the player see all other players, even through walls. Maybe as skeletons.
Haral: Sure. You'd either use the map->screen function or just find the distance from your viewrotation (not too hard) to know where they are "on your screen." Then you'd just draw a widget scaled to the distance between your pawn and the other pawn for the whole "skeleton" thing. An infrared view is on my todo and that's what I had in mind.
Mosquito: How about having the player's transpartent and have skeletons inside them, But what about custom models?
Foxpaw: The problem with drawing a widget is that it won't be in the same frame of animation as the actual pawn is. Canvas.Drawactor or Canvas.Drawscreenactor (One of these would work, I think) would work a lot better. I don't think you can even draw a mesh widget anyway, though I could be wrong about that. I like the idea of having the player's transparent, that would satisfy pretty much all custom models, as well. Technically a person COULD write their own skeleton and make all of the skeletal animations for it, and if it were radical enough compared to the built-in ones it might look a bit wierd, but so far I haven't seen anyone go to those lengths to make a new model. (This would only be necessary for things like quadrapedal models, etc.)
Haral: Err right. I didn't look at it that closely yet. Still, rather than doing anything so crazy as working with the skeleton or making a new one, you could just make a new texture that looks like an x-ray skeleton. If you were going for the low-budget approach anyway... you'd probably need to enforce the mesh on the pawns as well. Would alleviate work, anyway.
Foxpaw: Hold on, I had another idea. All species code has a skeleton variable that stores what mesh it should turn into if it gets skeletized, which I think only happens if you fall in lava or possibly from the ion cannon as well. LinkMesh is simulated, so you could have clients force them to change to that skeleton mesh without having actually been skeletized, without the server losing track of what the actual meshes are. This would also allow each client to see skeletons only when applicable. Canvas.Drawactor could be used to draw pawns on the screen maintaining their proper frame of animation.. that should satisfy all criteria. Remembering the skeletons from when you get skeletized was a real epiphany for me on this one. :P I hope that's descriptive enough, I think that actually solves all of the problems that I thought of before, even replication! I'll summarize in point form:
- Server spawns an actor at the beginning of the game to manage the X-Ray-ness.
- When the andrenaline combo is activated, the server sets some variables in an an array to tell all clients who just engaged the andrenaline combo. All pawns are also set to bAlwaysRelevant=true. (just in case)
- Upon reciept of this new element in the "X-Ray array," each client scans the array to see if their name is in it.
- If a client does not find their name in the list, return and don't check again until the next time the list is updated.
- If we do find our name in the list, then:
- Store the meshes of all pawns in the game in a dynamic array, along with a pointer to that pawn.
- Link all pawn's mesh to the skeleton mesh of their respective speciestype class. If they have no speciestype or a skeleton is not specified, use default (male jugg) skeleton.
- Spawn an interaction and link it to the local interaction list of the local player.
- Said interaction will call C.DrawActor on every pawn, except itself, every tick.
- When andrenaline combo/pickup/whatever expires, the server updates the array and removes the applicable name from the array.
- Since the array has changed, all clients check the list again. If they are in X-Ray mode and their name is not on the list:
- Restore the original meshes from the dynamic array and remove the elements in said array.
- Destroy the interaction and remove it from the list.
- Return to the second bullet point.